package com.max.xihu.patterns.responsible.validator;

import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.Map;

/**
 * @Author: Max
 * @Date: 2020-09-20 14:51
 * @Description:入参校验器
 */
public class ParamValidator extends BaseValidator {

    private String actName;

    private Date requestTime;

    public ParamValidator(String actName){
        this.actName = actName;
        this.requestTime = new Date();
    }

    @Override
    public boolean check(Map<String, Object> form) {
        String actName = (String) form.get("actName");
        if (StringUtils.isBlank(actName)){
            return false;
        }
        form.put("requestTime",requestTime);
        return checkNext(form);
    }
}
